
.excel-table-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.excel-toolbar {
  padding: 10px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.draggable-data {
  padding: 6px 12px;
  background-color: #e6f7ff;
  border: 1px dashed #1890ff;
  border-radius: 4px;
  cursor: grab;
  font-weight: 500;
  color: #1890ff;
  transition: all 0.2s;
  user-select: none;
}

.draggable-data:hover {
  background-color: #bae7ff;
  border-color: #40a9ff;
}

.draggable-data:active {
  cursor: grabbing;
}

.toolbar-btn {
}

/* 拖拽相关样式 */
.toolbar-btn {
  transition: all 0.2s;
}

.toolbar-btn:hover:not(:disabled) {
  background-color: #f0f0f0;
}

.delete-btn {
  color: #fff;
  background-color: #ff4d4f;
  border-color: #ff4d4f;
}

.delete-btn:hover:not(:disabled) {
  background-color: #ff7875;
  border-color: #ff7875;
}

.delete-btn:disabled {
  background-color: #d9d9d9;
  border-color: #d9d9d9;
  cursor: not-allowed;
}

.selection-info {
  margin-left: auto;
  font-size: 14px;
  color: #666;
}

.table-wrapper {
  flex: 1;
  overflow: auto;
  position: relative;
  background-color: #fff;
}

.excel-table {
  width: auto;
  border-collapse: collapse;
  position: relative;
}

/* 左上角空白单元格 */
.corner-cell {
  width: 40px;
  height: 30px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  cursor: pointer;
}

.corner-cell:hover {
  background-color: #e0e0e0;
}

/* 列标题 */
.column-header {
  min-width: 100px;
  height: 30px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  padding: 0 5px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 10;
}

.column-header:hover {
  background-color: #e0e0e0;
}

.column-header.selected {
  background-color: #cce7ff;
}

/* 行标题 */
.row-header {
  width: 40px;
  height: 30px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  padding: 0 5px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  position: sticky;
  left: 0;
  z-index: 5;
}

.row-header:hover {
  background-color: #e0e0e0;
}

.row-header.selected {
  background-color: #cce7ff;
}

/* 数据单元格 */
.data-cell {
  min-width: 100px;
  height: 30px;
  border: 1px solid #e0e0e0;
  padding: 2px 5px;
  cursor: cell;
  position: relative;
  user-select: text;
}

.data-cell:hover {
  background-color: #f5f5f5;
}

.data-cell.selected {
  background-color: #cce7ff;
}

.data-cell.editing {
  padding: 0;
}

.cell-edit-input {
  width: fit-content;
  height: 100%;
  border: none;
  outline: none;
  padding: 0 5px;
  font-family: inherit;
  font-size: inherit;
  box-sizing: border-box;
}

/* 选中框 */
.selection-box {
  position: absolute;
  background-color: rgba(0, 200, 83, 0.3);
  border: 2px solid #00c853;
  pointer-events: none;
  z-index: 20;
  /* 添加平滑过渡效果 */
  transition: left 0.05s ease, top 0.05s ease, width 0.05s ease, height 0.05s ease;
}

/* 拖拽预览 */
.drag-preview {
  position: absolute;
  background-color: rgba(0, 200, 83, 0.3);
  border: 2px solid #00c853;
  border-radius: 2px;
  pointer-events: none;
  z-index: 1000;
  animation: pulse 1.5s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* 添加平滑过渡效果 */
  transition: transform 0.1s ease, opacity 0.1s ease;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 200, 83, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 200, 83, 0);
  }
}

/* 拖拽预览内容容器 */
.drag-preview-content {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 2px;
  box-sizing: border-box;
}

/* 拖拽预览中的单元格 */
.drag-preview-cell {
  background-color: rgba(255, 255, 255, 0.8);
  color: #333;
  font-weight: 500;
  user-select: none;
}

/* 操作提示样式 */
.operation-toast {
  position: fixed;
  min-width: 200px;
  padding: 12px 16px;
  background-color: #52c41a;
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  pointer-events: none;
  transform: translateY(-10px);
  opacity: 0;
}

.operation-toast.success {
  background-color: #52c41a;
}

.operation-toast.error {
  background-color: #ff4d4f;
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  word-break: break-word;
}

/* 提示动画 */
.toast-fade-enter-active,
.toast-fade-leave-active {
  transition: all 0.3s ease;
}

.toast-fade-enter-from,
.toast-fade-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}

.toast-fade-enter-to {
  opacity: 1;
  transform: translateY(0);
}

/* 拖拽状态增强视觉反馈 */
.data-cell.dragging-source {
  background-color: #fff7e6;
  border: 1px dashed #fa8c16;
  opacity: 0.8;
  transition: all 0.1s ease;
}

.data-cell.drag-over {
  background-color: #2be478ab;
  border: 2px solid #00c853;
  transition: all 0.1s ease;
  box-shadow: 0 0 8px #00c853;
}

/* 整行选中 */
.data-row.selected {
  background-color: #cce7ff;
}

/* 选中数据显示面板样式 */
.selected-data-panel {
  margin-top: 20px;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.selected-data-panel h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #333;
}

.selected-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
}

.data-position {
  font-weight: 500;
  color: #666;
  min-width: 40px;
}

.data-value {
  color: #333;
  flex: 1;
  text-align: right;
  word-break: break-all;
}

/* 滚动条样式 */
.selected-data-grid::-webkit-scrollbar {
  width: 6px;
}

.selected-data-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.selected-data-grid::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.selected-data-grid::-webkit-scrollbar-thumb:hover {
  background: #999;
}